public class Date {
    public int year;
    public int month;
    public int day;

    public void setDate(int y, int m, int d){
        year = y;
        month = m;
        day = d;
    }
    public void setDate0(int year, int month, int day){
        //当形参跟成员变量一样了的时候会变成0
        //局部变量优先 大家都是局部变量 是同一个
        /*year = year;
        month = month;
        day = day;
         */
        // 想解决这个题就把成员变量前加上 this.
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void print(){
        System.out.println(year+" "+month+" "+day);
    }

public Date(){
        this.day = 22;
}
    public static void main(String[] args) {
        Date date1 = new Date();
        Date date2 = new Date();
        Date date3 = new Date();


        date1.setDate(2021,10,5);
        date1.print();
        date2.setDate(2022,10,5);
        date2.print();
        date3.setDate(2023,10,5);
        date3.print();
    }
}
